From 50dd671f2f0d233d5efd43ed634e72afe1e868cc Mon Sep 17 00:00:00 2001 From: robertlipe Date: Fri, 3 Jan 2014 05:29:49 +0000 Subject: [PATCH] Fix default read of boolean opts with '1' as the default. --- gpsbabel/gui/format.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gpsbabel/gui/format.h b/gpsbabel/gui/format.h index 8c1dead62..65d93e635 100644 --- a/gpsbabel/gui/format.h +++ b/gpsbabel/gui/format.h @@ -58,7 +58,13 @@ public: defaultValue_(defaultValue), minValue_(minValue), maxValue_(maxValue), html_(html) { value_ = QVariant(); - isSelected_ = false; + // Boolean values pay more atention to 'selected' than value. Make + // them match here. For non-bools, just make them unchecked. + if (type_ == OPTbool && defaultValue.toBool() == true) { + isSelected_ = true; + } else { + isSelected_ = false; + } } FormatOption(const FormatOption & c) -- 2.30.2